using Fungus;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class 灵感系统 : MonoBehaviour
{

    public Text PlayerLingGanText;
    public int Linggan;
    public bool Success;
    public bool Success2;

    // Start is called before the first frame update
    private void Awake()
    {
        PlayerLingGanText = GetComponent<Text>();
        DontDestroyOnLoad(gameObject);
    }
    private void Update()
    {
        PlayerLingGanText.text = "灵感:" + Linggan;
        对话1();
        对话2();
        
        
    }
    void 对话1()
    {
        Flowchart flowchart = GameObject.Find("Flowchart").GetComponent<Flowchart>();
        Success = flowchart.GetBooleanVariable("IfTalkright3");
        if (Success == true)
        {
            Linggan = 1;
        }
    }
    void 对话2()
    {
        Flowchart flowchart2 = GameObject.Find("Flowchart2").GetComponent<Flowchart>();
        Success2 = flowchart2.GetBooleanVariable("去迷宫");
        if (Success2 == true)
        {
            Linggan = 2;
        }
    }
}
    
    

